package com.hcbd.tdwt.ui.fuda.common.vo.weather;

/**
 * 灾害等级类型
 *
 * @author ZhDZ
 * @Date 2019年7月29日
 */
public enum DisasterLevelType {
    White(1, "白色"),
    Blue(2, "蓝色"),
    Yellow(3, "黄色"),
    Orange(4, "橙色"),
    Red(5, "红色");

    private int code;
    private String name;

    private DisasterLevelType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static DisasterLevelType get(int c) {
        for (DisasterLevelType w : DisasterLevelType.values()) {
            if (w.getCode() == c) {
                return w;
            }
        }
        return null;
    }

    public static DisasterLevelType get(String n) {
        for (DisasterLevelType w : DisasterLevelType.values()) {
            if (w.getName().equals(n)) {
                return w;
            }
        }
        return null;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
